var rule = {
  title: '瓜子影视',
  host: 'https://www.gzvod.cc/',
  url: '/index.php/vod/show/id/fyclass/page/fypage.html',
  searchUrl: '/index.php/vod/search/page/fypage/wd/**.html',
  searchable: 2,
  quickSearch: 0,
  filterable: 0,
  headers: {
    'User-Agent': 'MOBILE_UA',
  },
  class_parse: '.menu a:gt(0):lt(7);a&&Text;a&&href;.*/(.*?).html',
  play_parse: true,
lazy: `js:
try {
  // 获取加密数据的三种方式
  const getEncryptedUrl = () => {
    // 方式1：从内联脚本的player对象获取
    const playerScript = document.querySelector('#PlayerVideoArea script:not([src])')?.innerHTML;
    const playerMatch = playerScript?.match(/var player_aaaa\s*=\s*({[\s\S]*?})\s*;/);
    if (playerMatch) {
      try {
        const playerData = JSON.parse(playerMatch[1].replace(/,\s*}/g, '}'));
        return playerData.url || '';
      } catch(e) {console.log('JSON解析失败')}
    }

    // 方式2：从iframe地址参数获取
    const iframe = document.querySelector('#playleft iframe');
    if (iframe) {
      const srcParams = new URL(iframe.src).searchParams;
      return srcParams.get('url') || '';
    }

    // 方式3：从全局变量获取（备用方案）
    return typeof window.player_aaaa !== 'undefined' ? window.player_aaaa.url : '';
  };

  // 增强版解码函数
  const decodeQingShan = (encoded) => {
    // 去除前缀（兼容不同播放器）
    let payload = encoded.replace(/^[a-zA-Z]+-/, '');
    
    // 处理特殊编码字符
    const base64Safe = payload
      .replace(/_/g, '/')
      .replace(/-/g, '+')
      .replace(/[^A-Za-z0-9+/=]/g, '');

    // 多重Base64解码
    let decoded = '';
    try {
      decoded = atob(base64Safe);
      // 检测是否需要二次解码
      while(/^[A-Za-z0-9+/=]+$/.test(decoded)) {
        const temp = atob(decoded);
        if(temp === decoded) break;
        decoded = temp;
      }
    } catch(e) {console.log('Base64解码失败')}

    // 协议头补全策略
    const addProtocol = (url) => {
      if(url.startsWith('http')) return url;
      if(url.startsWith('://')) return 'https' + url;
      if(url.startsWith('//')) return 'https:' + url;
      return 'https://' + url;
    };

    return addProtocol(decoded);
  };

  // 智能点击系统（支持预加载检测）
  const clickSystem = () => {
    const iframeWindow = document.querySelector('#playleft iframe')?.contentWindow;
    if (!iframeWindow) return;

    // 递归元素检测（支持Shadow DOM）
    const deepQuery = (selector, root = iframeWindow.document) => {
      try {
        // 优先常规查询
        const el = root.querySelector(selector);
        if(el) return el;
        
        // Shadow DOM检测
        const shadows = root.querySelectorAll('*');
        for (const node of shadows) {
          if (node.shadowRoot) {
            const shadowEl = deepQuery(selector, node.shadowRoot);
            if(shadowEl) return shadowEl;
          }
        }
      } catch(e) {}
    };

    // 点击执行逻辑
    const doClick = () => {
      const clickTargets = [
        '#start',         // 常规播放按钮
        '.play-btn',      // 通用播放按钮
        '[onclick*="play"]' // 含播放事件的元素
      ];

      for (const selector of clickTargets) {
        const target = deepQuery(selector);
        if(target) {
          target.click();
          console.log('成功点击元素:', selector);
          return true;
        }
      }
      return false;
    };

    // 多种触发方式
    const triggerStrategies = {
      immediate: () => doClick(),
      domReady: () => {
        iframeWindow.document.addEventListener('DOMContentLoaded', doClick);
      },
      timeout: (retry = 0) => {
        if(retry > 5) return;
        setTimeout(() => {
          if(!doClick()) triggerStrategies.timeout(retry + 1);
        }, 500 * Math.pow(2, retry));
      }
    };

    // 执行所有触发策略
    Object.values(triggerStrategies).forEach(fn => fn());
  };

  // 主流程执行
  const encrypted = getEncryptedUrl();
  if (!encrypted) throw new Error('未找到加密数据');

  const finalUrl = decodeQingShan(encrypted);
  if (!finalUrl) throw new Error('解码失败');

  // 构造结果对象
  input = {
    parse: 1,
    url: finalUrl,
    js: clickSystem.toString(),
    click: clickSystem.toString(),
    header: {
      'Referer': 'https://jx.vodplayer.cn/',
      'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
    }
  };

} catch (e) {
  console.error('[解析异常]', e.message);
  input = '';
}
`,
  limit: 6,
  double: true,
  推荐: '*',
  一级: '.myui-vodbox-content a;.card-info .title&&Text;img&&src;.score&&Text;a&&href',
  二级: {
    title: '.title-box&&h1&&Text;.tag:eq(3)&&Text',
    img: 'img&&src',
    desc: '.tags.text-overflow&&Text;.tag:eq(1)&&Text;.tag:eq(2)&&Text;.director.text-overflow:eq(0)&&Text;.director.text-overflow:eq(1)&&Text',
    content: '.intro&&Text',
    tabs: '.nav.nav-btn li',
    lists: '.tab-pane.lists-box:eq(#id) a',
  },
  搜索: '*',
}